public class digui {
    /*public static int max2(int a, int b) {
        if (a > b) {
            return a;
        } else {
            return b;
        }
    }

    public static int max3(int a, int b, int c) {
        if (max2(a, b) > max2(a, c)) {
            int n = max2(a, b);
            return n;
        } else {
            int n = max2(a, c);
            return n;
        }
    }

    public static void main(String[] args) {
        int n = max3(1, 2, 3);
        System.out.println(n);
    }*/


//求和的重载

   /* public static int add(int a, int b) {
        return a + b;
    }
    public static double add(double a, double b) {
        return a + b;
    }

    public static void main(String[] args) {
        int n=add(1,2);
        double m=add(1.5,1.4);
        System.out.println(n);
        System.out.println(m);
    }*/

    //求最大值方法的重载

    /*public static int max(int a, int b) {
        return a > b ? a : b;
    }

    public static double max(double a, double b,double c) {
        double n = a > b ? a : b;
        double m = a > c ? a : c;
        return n > m ? n : m;
    }

    public static void main(String[] args) {
        int r=max(1,2);
        double t=max(1.4,3.4,2.3);
        System.out.println(r);
        System.out.println(t);
    }*/

    //汉诺塔问题的解决（递归思想）

    public static int count;

    public static long hanno(int n,char A,char B,char C) {

        if(n==1){
            count++;
            System.out.println("第" + count + "步: 移动盘子 1 从 " + A + " 到 " + C);
            return count;
        }
        hanno(n-1,A,C,B);
        count++;
        System.out.println("第" + count + "步: 移动盘子"+ n+"从 " + A + " 到 " +C);
        hanno(n-1,B,A,C);
        return count;

    }

    public static void main(String[] args) {
        long r=hanno(3,'a','b','c');
        System.out.println(r);
    }
}
